class Book:
    def __init__(self, name, author, price):
        self.name = name
        self.author = author
        self.price = price

    def disp(self):
        print(f"《{self.name}》，由{self.author}所写。现售价{self.price:.1f}元。")

    def comp(self, count, print_to_console=True):
        result = self.price * count
        if print_to_console:
            print(f"{count}本{self.name}的总价格为{result:.1f}元")
        return result


def main():
    book = Book("新百年新中国", "张维为", 60)
    book.disp()
    count = int(input("本数："))
    _ = book.comp(count)


if __name__ == "__main__":
    main()
